import datetime

from django.db import models

# Create your models here.
class EmpInfo(models.Model):
    name = models.CharField(max_length=16, verbose_name='员工姓名')
    password = models.CharField(max_length=64, verbose_name='员工密码')
    age = models.IntegerField(verbose_name='员工年龄')
    account = models.DecimalField(verbose_name='账户余额', max_digits=10, decimal_places=2, default=0)
    entry_date = models.DateField(verbose_name='入职时间')
    # 约束
    gender_choice = (
        (1, '男'),
        (2, '女')
    )
    gender = models.SmallIntegerField(default=1, choices=gender_choice, verbose_name='性别')
    # 外键
    dept = models.ForeignKey(verbose_name='所属部门', to='dept.DeptInfo', to_field='id', on_delete=models.SET_NULL, blank=True, null=True)